import { onMounted } from 'vue';
import { gaode } from '../../../gis_layer/gaode'
import { app } from '@/main'
export const useMapHook = () => {
    onMounted(() => {
        const map = new ol.Map({
            target: "map",
            /* 设置地图图层 */
            layers: [gaode],
            /* view设置地图 以坐标,中心点,放大级别 */
            view: new ol.View({
                center: [114.3, 30.5],
                zoom: 4,
                //经纬度坐标系
                projection: "EPSG:4326",
            }),
        });
        app.provide("$map", map)
    })

}